﻿using Catalogo.Portable.ViewModel.Messages;
using System;
using System.Reflection;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Catalogo.Windows8.Views
{
    public class NavegarParaPaginaMessageHandler
    {
        public static void NavegarParaPagina(NavegarParaPagina mensagem)
        {
            var framePrincipal = ((Frame)Window.Current.Content);
            var sourcePageType = Type.GetType(string.Format("Catalogo.Windows8.Views.{0}", mensagem.Pagina));
            framePrincipal.Navigate(sourcePageType, mensagem.Parametro);
        }
    }
}
